\(\int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx\) [31]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 109 \[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=-\frac {\cot (e+f x) (a+a \csc (e+f x))^m}{f (1+m)}-\frac {2^{\frac {1}{2}+m} m \cot (e+f x) (1+\csc (e+f x))^{-\frac {1}{2}-m} (a+a \csc (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\csc (e+f x))\right )}{f (1+m)} \]

[Out]

-cot(f*x+e)*(a+a*csc(f*x+e))^m/f/(1+m)-2^(1/2+m)*m*cot(f*x+e)*(1+csc(f*x+e))^(-1/2-m)*(a+a*csc(f*x+e))^m*hyper
geom([1/2, 1/2-m],[3/2],1/2-1/2*csc(f*x+e))/f/(1+m)

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3883, 3913, 3912, 71} \[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=-\frac {2^{m+\frac {1}{2}} m \cot (e+f x) (\csc (e+f x)+1)^{-m-\frac {1}{2}} (a \csc (e+f x)+a)^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\csc (e+f x))\right )}{f (m+1)}-\frac {\cot (e+f x) (a \csc (e+f x)+a)^m}{f (m+1)} \]

[In]

Int[Csc[e + f*x]^2*(a + a*Csc[e + f*x])^m,x]

[Out]

-((Cot[e + f*x]*(a + a*Csc[e + f*x])^m)/(f*(1 + m))) - (2^(1/2 + m)*m*Cot[e + f*x]*(1 + Csc[e + f*x])^(-1/2 -
m)*(a + a*Csc[e + f*x])^m*Hypergeometric2F1[1/2, 1/2 - m, 3/2, (1 - Csc[e + f*x])/2])/(f*(1 + m))

Rule 71

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c
 - a*d))^n))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-d/(b*c - a*d), 0]))

Rule 3883

Int[csc[(e_.) + (f_.)*(x_)]^2*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-Cot[e + f*x])*(
(a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[a*(m/(b*(m + 1))), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x],
 x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)]

Rule 3912

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Dist[a^2*d
*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]])), Subst[Int[(d*x)^(n - 1)*((a + b*x)^(m -
 1/2)/Sqrt[a - b*x]), x], x, Csc[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !In
tegerQ[m] && GtQ[a, 0]

Rule 3913

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Dist[a^Int
Part[m]*((a + b*Csc[e + f*x])^FracPart[m]/(1 + (b/a)*Csc[e + f*x])^FracPart[m]), Int[(1 + (b/a)*Csc[e + f*x])^
m*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[m] &&  !GtQ
[a, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cot (e+f x) (a+a \csc (e+f x))^m}{f (1+m)}+\frac {m \int \csc (e+f x) (a+a \csc (e+f x))^m \, dx}{1+m} \\ & = -\frac {\cot (e+f x) (a+a \csc (e+f x))^m}{f (1+m)}+\frac {\left (m (1+\csc (e+f x))^{-m} (a+a \csc (e+f x))^m\right ) \int \csc (e+f x) (1+\csc (e+f x))^m \, dx}{1+m} \\ & = -\frac {\cot (e+f x) (a+a \csc (e+f x))^m}{f (1+m)}+\frac {\left (m \cot (e+f x) (1+\csc (e+f x))^{-\frac {1}{2}-m} (a+a \csc (e+f x))^m\right ) \text {Subst}\left (\int \frac {(1+x)^{-\frac {1}{2}+m}}{\sqrt {1-x}} \, dx,x,\csc (e+f x)\right )}{f (1+m) \sqrt {1-\csc (e+f x)}} \\ & = -\frac {\cot (e+f x) (a+a \csc (e+f x))^m}{f (1+m)}-\frac {2^{\frac {1}{2}+m} m \cot (e+f x) (1+\csc (e+f x))^{-\frac {1}{2}-m} (a+a \csc (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-m,\frac {3}{2},\frac {1}{2} (1-\csc (e+f x))\right )}{f (1+m)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.97 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.16 \[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=-\frac {(a (1+\csc (e+f x)))^m \left ((-1+m) \cot ^2\left (\frac {1}{2} (e+f x)\right ) \operatorname {Hypergeometric2F1}\left (-1-m,-2 m,-m,-\tan \left (\frac {1}{2} (e+f x)\right )\right )+(1+m) \operatorname {Hypergeometric2F1}\left (1-m,-2 m,2-m,-\tan \left (\frac {1}{2} (e+f x)\right )\right )\right ) \tan \left (\frac {1}{2} (e+f x)\right ) \left (1+\tan \left (\frac {1}{2} (e+f x)\right )\right )^{-2 m}}{2 f (-1+m) (1+m)} \]

[In]

Integrate[Csc[e + f*x]^2*(a + a*Csc[e + f*x])^m,x]

[Out]

-1/2*((a*(1 + Csc[e + f*x]))^m*((-1 + m)*Cot[(e + f*x)/2]^2*Hypergeometric2F1[-1 - m, -2*m, -m, -Tan[(e + f*x)
/2]] + (1 + m)*Hypergeometric2F1[1 - m, -2*m, 2 - m, -Tan[(e + f*x)/2]])*Tan[(e + f*x)/2])/(f*(-1 + m)*(1 + m)
*(1 + Tan[(e + f*x)/2])^(2*m))

Maple [F]

\[\int \csc \left (f x +e \right )^{2} \left (a +a \csc \left (f x +e \right )\right )^{m}d x\]

[In]

int(csc(f*x+e)^2*(a+a*csc(f*x+e))^m,x)

[Out]

int(csc(f*x+e)^2*(a+a*csc(f*x+e))^m,x)

Fricas [F]

\[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=\int { {\left (a \csc \left (f x + e\right ) + a\right )}^{m} \csc \left (f x + e\right )^{2} \,d x } \]

[In]

integrate(csc(f*x+e)^2*(a+a*csc(f*x+e))^m,x, algorithm="fricas")

[Out]

integral((a*csc(f*x + e) + a)^m*csc(f*x + e)^2, x)

Sympy [F]

\[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=\int \left (a \left (\csc {\left (e + f x \right )} + 1\right )\right )^{m} \csc ^{2}{\left (e + f x \right )}\, dx \]

[In]

integrate(csc(f*x+e)**2*(a+a*csc(f*x+e))**m,x)

[Out]

Integral((a*(csc(e + f*x) + 1))**m*csc(e + f*x)**2, x)

Maxima [F]

\[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=\int { {\left (a \csc \left (f x + e\right ) + a\right )}^{m} \csc \left (f x + e\right )^{2} \,d x } \]

[In]

integrate(csc(f*x+e)^2*(a+a*csc(f*x+e))^m,x, algorithm="maxima")

[Out]

integrate((a*csc(f*x + e) + a)^m*csc(f*x + e)^2, x)

Giac [F]

\[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=\int { {\left (a \csc \left (f x + e\right ) + a\right )}^{m} \csc \left (f x + e\right )^{2} \,d x } \]

[In]

integrate(csc(f*x+e)^2*(a+a*csc(f*x+e))^m,x, algorithm="giac")

[Out]

integrate((a*csc(f*x + e) + a)^m*csc(f*x + e)^2, x)

Mupad [F(-1)]

Timed out. \[ \int \csc ^2(e+f x) (a+a \csc (e+f x))^m \, dx=\int \frac {{\left (a+\frac {a}{\sin \left (e+f\,x\right )}\right )}^m}{{\sin \left (e+f\,x\right )}^2} \,d x \]

[In]

int((a + a/sin(e + f*x))^m/sin(e + f*x)^2,x)

[Out]

int((a + a/sin(e + f*x))^m/sin(e + f*x)^2, x)